package com.jic.interaction.hereWeGo.controller;

import com.github.pagehelper.PageInfo;
import com.jic.interaction.hereWeGo.common.utlis.RestResult;
import com.jic.interaction.hereWeGo.model.entity.AccountChecking;
import com.jic.interaction.hereWeGo.model.vo.request.AccountCheckingRequest;
import com.jic.interaction.hereWeGo.service.AccountCheckingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @ClassName AccountCheckingController
 * @Description TODO
 * @Author 陈鸿锋
 * @Date 2020/11/9 19:59
 * @Version 1.0
 **/
@Api(value="对账接口", tags = "对账接口", description = "AccountCheckingController")
@RestController
@RequestMapping("/Account")
public class AccountCheckingController {
    @Autowired
    AccountCheckingService accountCheckingService;

    @ApiOperation(value = "查询对应⽉份的交易记录。", notes = "查询对应⽉份的交易记录。")
    @PostMapping("/queryAccount")
    public RestResult<PageInfo<?>> getQueryAccount(@Valid @RequestBody AccountCheckingRequest request) throws Exception {
        AccountChecking param=new AccountChecking();
       BeanUtils.copyProperties(request,param);
        PageInfo<?> pageInfo = accountCheckingService.queryAccount(param, request.getCurrentPage(), request.getPageSize());
        return RestResult.success("0000",pageInfo);
    }
}
